package fitnesshub.controller.member;

import fitnesshub.pojo.dto.EquipmentPageQueryDTO;
import fitnesshub.result.PageResult;
import fitnesshub.result.Result;
import fitnesshub.service.EquipmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员-设备
 */
@RestController
@RequestMapping("/member/equipment")
@Slf4j
public class MemberEquipmentController {
    @Autowired
    private EquipmentService equipmentService;

    /**
     * 设备分页
     *
     * @param equipmentPageQueryDTO 分页查询参数对象
     * @return 包含分页结果的Result对象
     */
    @GetMapping("/page")
    public Result<PageResult> page(EquipmentPageQueryDTO equipmentPageQueryDTO) {
        log.info("设备分页查询，参数：{}", equipmentPageQueryDTO);
        PageResult pageResult = equipmentService.page(equipmentPageQueryDTO);
        return Result.success(pageResult);
    }
}
